<template>
   <div class="shoucangBox">
    <div class="head">
        <van-nav-bar
title="收藏列表"
left-text="返回"
right-text="。。。"
left-arrow
@click-left="onClickLeft"
/>
    </div>
    <div class="center">
        <div class="item"  >
            <h2 v-if="(list.length==0)">收藏列表为空</h2>
      <div @click="toDetail(item.mtWmPoiId)" v-for="(item,index) in list" v-bind:key="index">
        <img :src="item.picUrl" alt="">
        <h5>{{item.name}}</h5>
   
        <p>{{item.deliveryTimeTip}}</p>
        <p>{{item.distance}}</p>
      </div>
    </div>
        
    </div>
   </div>
</template>

<script>
import {shop_favlist} from '../api/api'
export default {
    data(){
        return{
            list:{

            }
        }
    },
    methods:{
        onClickLeft(){
          this.$router.go(-1)
        }
      },mounted(){
        shop_favlist({params:{userid:2136}}).then((res)=>{
            if(res.data.code==200){
               this.list= res.data.list
            }
           
            console.log(res.data);
        })
      }
}
</script>

<style scoped>
h2{
    text-align: center;
    margin-top: 200px;
    color: red;
}
.item{
  height: 430px;
 overflow: auto;
}
.item div{
  display: flex;
  width: 100%;
  justify-content: space-around;
  margin-item: 10px;
  background: white;
}
.item h5{
  height: 50px;
  width: 100px;
  margin-right: 20px;
}
.item p{
  font-size: 14px;
}
.top p{
  font-weight: bold;
}
.item img{
  width: 80px;
  height: 80px;
}
</style>